package com.hongye.common.response;

import lombok.Data;

import java.util.Map;

/*
    凤兮凤兮归故乡，遨游千里求其凰
    2021/7/16
*/
@Data
public class ResponseResult {

    private Integer code;  //错误码

    private String message;  //错误信息

    private Map<String,Object> data;  //返回数据集合

    public ResponseResult(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResponseResult(Integer code, String message, Map<String, Object> data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static ResponseResult ok(Integer code, String message, Map<String, Object> data){
        return new ResponseResult(code,message,data);
    }

    public static ResponseResult error(Integer code, String message){
        return new ResponseResult(code,message);
    }
}
